package cn.edu.lingnan.controller;

import cn.edu.lingnan.service.BanjiFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 面向common中的service接口编程
 * @Author: chen_man_cheng
 * @Description: //TODO
 * @Date: Create in 15:24 2020/6/8
 */
@RestController
@RequestMapping("banji/feign")
public class BanjiComsumerFeignController {
    @Autowired
    private BanjiFeignService banjiFeignService;

//    客户端的请求路径是banji/feign/queryAll;然后方法去调用banjiFeignService的方法。banjiFeignService再调用服务提供者的方法，访问数据库
    @RequestMapping("queryAll")
    public Object queryAll() {
        return banjiFeignService.queryAll();
    }
}
